home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
FILE_SEA
/
README
< prev
Wrap
Text File
|
1991-01-17
|
2KB
|
53 lines
Essentialy these routines will help you search for a file, set the current dir,
store the last known location in a resource, and get the path.
All the routines that you will call need to have a file record that we have
defined passed to them.
typedef struct {
char fileName[32]; /* Pass a C String here*/
short ioVRefNum;
long ioDirID;
} fileFindRec;
To find a file copy the file name into fileName. The ioVRefNum the ioDirID, fields
will be filled in by the searching routine. Next, decide the scope of your
search. By passing a combination of the constants below a file search can be
set to any desired scope.
RESTRICT
CURRENT
BOOTDIR
FOLDER
PARENT
WVOLUME
ALLVOLUME
strcpy (theRec.fileName,"The file I Want");
doFileSearch (&theRec,RESTRICT | FOLDER);--limits to the current directory only
--folders within the current directory
--are NOT searched
doFileSearch (&theRec,PARENT | FOLDER);--will search:
the parent
the current
any folders within the current
Once you have found your file before it can be accessed we need to set the default
directory, use the routine, (fileSetDflt) passing in the appropiate file record.
It will set and give you back the working directory ID.
If you find the file you are looking for you might want to save it's last known
location, there are two routines that can help you accomplish this:
fileSaveToRsrc
fileGetFromRsrc
These routines do not cover MFS, only the HFS file system.
Must have at least 128K ROMS.
Thats it.. I hope this helps, Apple's documentation in this area is really hit
and miss.
--Wes Zuber, Clear View Systems--
--CIS 72607,3502 --